<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
include  'admin/Util.php';
?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta http-equiv="content-language" content="en" />
        <meta name="author" content="Daniel Kloud (coding), Adam Biganovský (design)" />
        <meta name="copyright" content="" />
        <meta name="robots" content="all,follow" />
        <meta name="description" lang="cs" content="" />
        <meta name="description" lang="en" content="" />
        <meta name="keywords" content="" />
        <title>Fibix Studio - Interactive 3D visualizations</title>
        <link rel="stylesheet" type="text/css" href="media/default.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="lightbox/lightbox.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="media/easySlide.css" media="screen" />

        <!-- TODO: doplnit meta copyright, description, keywords -->
        <script type="text/javascript" src="js/flowplayer-3.2.0.min.js"></script>
        <script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
        <script type="text/javascript" src="js/easySlider1.5.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("#slider").easySlider({
                    prevText: 'Previous',
                    nextText: 'Next',
                    auto: false,
                    continuous: true
                });
            });
        </script>

    </head>
    <body>
        <h1>Fibix Studio &ndash; Interactive 3D Visuals</h1>

        <?php
        include  'menu.php';
        ?>

        <!-- CONTENTS START -->

        <div id="contents">
            <div class="boxtop"></div>
            <div class="boxhdr"><h2>Technology</h2></div>
            <div class="boxtxt">

                <?php

                $flashContents = file_get_contents('flash.php');
                $getFlashPath = 'admin/form/uploads/video.flv';
                echo  str_replace('$getFlashPath', $getFlashPath, $flashContents);
                ?>
                <?php
                $link = Util::getLink();
                $imagesLast = false;
                for ($i = 1; $i < 3; $i++) {
                    $query = sprintf(Util::$select_jornakTechnologyBySectionId,
                        mysql_real_escape_string($i)
                    );

                    $result = mysql_query($query);

                    if (!$result) {
                        die('Could not query:' . mysql_error());
                    }
                    $row = mysql_fetch_assoc($result);
                    if ($imagesLast) {
                        echo '<div class="boxhdr"><h2>'.stripslashes($row['headline']).'</h2></div><div class="boxtxt">';
                    }else {
                        echo '<h3>'.stripslashes($row['headline'])."</h3>";
                    }
                    echo '<p>'.stripslashes($row['text']).'</p>';
                    echo stripslashes($row['list']);
                    $myArray = explode(';',$row['imgs']);

                    //obrazky
                    $count = count($myArray);
                    //print_r($myArray);
                    $j = 0;
                    if ($myArray[$j] != '') {
                        echo '<div id="slider" class="boximg"><ul>';
                        $k = 0;
                        while($k*5 < $count) {
                            $advancedCount = $count - $k*5;
                            if ($advancedCount > 4){
                                $l = 5;
                            }else{
                                $l = $advancedCount;
                            }
                            echo '<li>';
                            for ($j = 0; $j < $l; $j++) {
                                if ($myArray[$j] != null) {
                                    echo '<a href="Image.php?id='.$myArray[$j].'"><img src="Image.php?id='.$myArray[$j].'&tn=true" alt="" /></a>';
                                }
                            }
                            echo '</li>';
                            $k++;
                        }
                        echo '</ul></div><br />';
                        if ($i < 3) echo '</div>';
                        $imagesLast = true;
                    }else {
                        echo "<hr />";
                        $imagesLast = false;
                    }
                //konecobrazku
                }

                Util::closeLink($link);

                ?>
                <div id="cleaner"></div>
            </div>
            <div class="boxbtm"></div>
        </div>

        <!-- CONTENTS END -->

        <?php
        include  'footer.php';
        ?>

    </body>
    <?php include 'googleAnalyt.php';?>

</html>